﻿<Window x:Class="WpfWordsLearner.Views.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
		xmlns:me="clr-namespace:WpfWordsLearner.ViewModels" 
		Title="Learning words" Height="440" Width="500">
	<DockPanel>
		<Menu x:Name="mainMenu" DockPanel.Dock="Top">
			<MenuItem x:Name="miFile" Header="_File">
				<MenuItem x:Name="miExit" Header="Exit" Command="{Binding Path=ExitCommand}"/>
			</MenuItem>
			<MenuItem x:Name="miWords" Header="_Word">
				<MenuItem x:Name="miAddWord" Header="Add word" Command="{Binding Path=ClickCommand}"/>
				<MenuItem x:Name="miAddWordRange" Header="Add word range"  Command="{Binding Path=AddWordRangeCommand}"/>
			</MenuItem>
			<MenuItem x:Name="miTest" Header="_Test">
				<MenuItem x:Name="miBegin" Header="Begin test" Command="{Binding Path=BeginTetsCommand}"/>
			</MenuItem>
		</Menu>
	<Grid DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window},Path=DataContext }">
		<Grid.RowDefinitions>
			<RowDefinition/>
			<RowDefinition Height="28"/>
		</Grid.RowDefinitions>
		<DataGrid x:Name="dataWords" AutoGenerateColumns="False"
				  ItemsSource="{Binding Words}">
			<DataGrid.Columns>
				<DataGridTextColumn  Header="English" Binding="{Binding Path=EnglishWord}" Width="190"/>
				<DataGridTextColumn  Header="Translate" Binding="{Binding Path=Translate}" Width="280"/>
			</DataGrid.Columns>
		</DataGrid>
		<Button x:Name="btnAdd" Content="Add"  Command="{Binding Path=ClickCommand}"
				Grid.Row="1" Width="80" />
	</Grid>
	</DockPanel>
</Window>
